package cn.tedu.shoot;

import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * @author JokerQiu
 * @desc 天空
 * @date 2021/12/05
 */
public class Sky extends FlyingObject {
    private int step;
    private int y1; //天空移动


    /** 构造方法 */
    public Sky(){
        width = Start.WIDTH;
        height = Start.HEIGHT;
        x = 0;
        y = 0;
        step = 1;
        y1 = -this.height;
    }

    /** 天空走步step() */
    public void step(){
        y+=step;
        y1+=step;
        if(y>=this.height){
            y=-this.height;
        }
        if(y1>=this.height){
            y1=-this.height;
        }
    }

    public BufferedImage getImage(){
        return Images.sky;
    }

    public void paint(Graphics g){
        g.drawImage(getImage(),x,y,null);
        g.drawImage(getImage(),x,y1,null);
    }

    public boolean outOfBounds(){
        return false;
    }
}
